package algotithm.interview.神策数据test.test3;

import java.util.HashMap;
import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;

/**
 * @author zhouyanxiang
 * @Date 2021-03-2021/3/1-22:30
 * 80%
 * aaadccc
 * a3d1c3
 */
public class Main {
    public static void main(String[] args) {
        Scanner scanner  = new Scanner(System.in);
        String s = scanner.nextLine();
        char[] c = s.toCharArray();
        HashMap<Character, Integer> map = new HashMap<>(20);
        Set<Character> set = new HashSet<>();
        for (int i = 0; i < c.length; i++) {
            map.put(c[i],map.getOrDefault(c[i],0) + 1);
        }
        StringBuilder sb = new StringBuilder();
        for (int i = 0; i < c.length; i++) {
            if (!set.contains(c[i])) {
                sb.append(String.valueOf(c[i])).append(map.get(c[i]));
            }
            set.add(c[i]);
        }
        String str = sb.toString();
        System.out.println(str);
        scanner.close();
    }

}
